1. Field of the Invention
This invention relates to a numerical control (NC) method and, more particularly, to an NC unit processing method through which a single processor executes numerical control processing based on a numerical control program and sequence control processing based on a sequence program at predetermined times on a time-sharing basis.
2. Description of the Related Art
In a numerical control system, the processor of the NC unit (1) executes numerical control processing under the control of a numerical control program based on NC data (part program data) to transport a movable machine element (a tool or table), and (2) executes sequence processing under the control of a sequence program in accordance with M-, S- and T-function instructions which perform miscellaneous, spindle speed and tool selection functions, respectively, are contained in the NC data and contact signals from a machine tool to control the various mechanical elements of the machine tool on the basis of the results of this processing.
The processor executes the numerical control processing based on the numerical control program and the sequence control processing based on the sequence program at predetermined times on a time-sharing basis.
FIG. 5 is a block diagram of an NC unit in which a single processor executes numerical control processing and sequence program processing on a time-sharing basis. Numeral 1 denotes the NC unit, and numeral 2 designates a machine tool.
Numeral 101 denotes an NC tape in which NC data (part program data) are punched, 102 a tape reader (though another medium and reading device may be used), 103 a RAM for storing the NC data punched in the NC tape 101 as well as the results of processing, 104 a ROM in which a numerical control program has been stored, 105 a processor (CPU), 106 a pulse distributing circuit for executing pulse distribution computations upon having amounts of travel X.sub.0, Y.sub.0 along the respective axes per predetermined lengths of time inputted thereto, 107 a bus line, 108 a manual data input unit (MDI unit), 109 an interface circuit, 110 a parameter memory for storing various parameters, and 111 an EROM (erasable ROM). The EROM 111 stores (a) a sequence program and (b) a correspondence table of correspondence between symbols (operands) and storage locations in the RAM 103 at which the logic values ("1" or "0 ") of these operands are stored.
The sequence program is one in which the functions of a magnetics circuit that administers the exchange of data between the NC unit 1 and machine tool 2 are programmed logically in the form of instruction codes and operands. The functions are programmed as shown in FIG. 6, by way of example. In the sequence program, RD, OR, AND, WRT, AND NOT, OR NOT and so forth are instruction codes, in which RD is a read instruction, AND a logical product instruction, WRT a write instruction, OR a logical sum instruction, AND NOT an instruction of a logical product with a negative value, and OR NOT an instruction of a logical sum with a negative value. Further, MF, M28, . . . , AUT, M03, . . . CRA are operands expressed by symbols, the logic values ("1" or "0") of which are stored at predetermined addresses and predetermined bits of the RAM 103.
The processor 105 executes numerical control processing based on the numerical control program and sequence control processing based on the sequence program at predetermined times on a time-sharing basis. In sequence control processing, the instructions of the sequence program are executed successively starting from the first instruction.
The larger the system, e.g. the larger the number of controlled axes, the longer the time required for numerical control processing. For this reason, the conventional practice is to decide a time T.sub.1 for execution of numerical control processing and a time T.sub.2 for execution of sequence processing upon presupposing the size of the largest system, and execute the numerical control processing (T.sub.1 ) and sequence processing (T.sub.2) on this time-sharing basis every predetermined time T (T&gt;T.sub.1 +T.sub.2).
With this method of processing, however, the length of time T.sub.2 for execution of sequence processing is fixed even if the time required for numerical control processing is shortened by reducing the size of the system. The problem that results is that the processor is not used efficiently.